#include "settings.h"
#include <QDebug>

Settings::Settings()
    :  mSetting("/home/pi/wetterstation/config.ini", QSettings::IniFormat)
{
    getConfigInfos();
}

Settings::~Settings() {
}

void Settings::getConfigInfos() {
    mSetting.beginGroup("measure");
        mTempInfo       =   mSetting.value("temperature").toBool();
        mHumiInfo       =   mSetting.value("humidity").toBool();
        mHasDB          =   mSetting.value("writedb").toBool();
        mZyclus         =   mSetting.value("zyclus").toInt();
        mCountMeasures  =   mSetting.value("countMeasures").toInt();
        mSensors        =   mSetting.value("sensor").toString();
    mSetting.endGroup();
}

bool Settings::getTempInfo() {
    return mTempInfo;
}

bool Settings::getHumiInfo() {
    return mHumiInfo;
}

int Settings::getZyclus() {
    return mZyclus;
}

bool Settings::getDB() {
    return mHasDB;
}

QString Settings::getSensors() {
    return mSensors;
}

int Settings::countMeasures() {
    return mCountMeasures;
}
